package com.example.spookydoors;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.view.Menu;
import android.view.View;
import android.widget.TextView;

public class GameOver extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_game_over);
		this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
		TextView scoreBox = (TextView) findViewById(R.id.finalScoreBox);
		Bundle extras = getIntent().getExtras();
		int score = 0;
		if (extras != null) {
		    score = extras.getInt("score");
		}
		scoreBox.setText("You escaped with " + score + " candies.");
		
	}
	
	public void newGame (View v) {
    	Intent i = new Intent(this, GameActivity.class);
    	startActivity(i);
    	finish();
    }
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.game_over, menu);
		return true;
	}

}
